//Title: Selection, Patience, and the Interest Rate
//Names of Authors: Radoslaw (Radek) Stefanski and Alex Trew
//Date: 07/09/2023

*houskeeping
clear
clear matrix
set mem 3000m
set more off
args base 

//----------

//Base Directory - set to directory containing this file
global base = "/Users/rls7/Library/CloudStorage/Dropbox/Shared_Projects/Long run beta/Writeup/5_JPE Macro_R2_final/Code"

// If necessary uncomment to install the following packages from the internet:
//ssc install tabstatmat 
//ssc install mat2txt
//ssc install hprescott

//1) Obtain an index of GDP per capita and population as well as growth rates over the three periods; also generate a population file helpful to other modules
do "$base/StataCode/globalGDPPop.do"
do "$base/StataCode/ObtainCleanPopulationMaddison.do"

//2) Construct denormalize GPS data
do "$base/StataCode/ObtainCleanDenormPatienceGPS.do"

//3) Calcualte Long run Rates of Return using data extracted from the Credit Suisse Global Investment Returns Yearbook
do "$base/StataCode/ObtainCleanRatesOfReturnEBT.do"
do "$base/StataCode/ObtainRateOfReturnpost2000EBT.do"
do "$base/StataCode/TablesA5-A6_LongRunReturnsEBT.do"

//4) Obtain long run  globalconsumption share
do "$base/StataCode/ObtainLongRunConsShare.do"

//5) Obtain English/UK Survival probability data
do "$base/StataCode/FigureA2_UKSurvivalProbabilities.do"


//6) Draw Long Rates of Return from Schmelzing, Clark etc in Figures A1
do "$base/StataCode/FigureA1_DrawSchemlzingDataAppendix.do"

//7)Calculate the proxy for child costs by looking at the relative price of the service sector to the CPI in the UK/England
do "$base/StataCode/Figure7B_UKSectoralPrices.do"
